ci: build every feature level separately
authorFelix Krull <f_krull@gmx.de>
Tue, 31 Mar 2020 20:59:04 +0000 (22:59 +0200)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:55 +0000 (12:53 -0400)
rust-bindings/rust/.gitlab-ci.yml
rust-bindings/rust/Cargo.toml
rust-bindings/rust/Makefile

index af1cae598143d6d0a60170a6d78d3849a992996c..29564aa963e5afdad2ba8c053fac89b25163af9e 100644 (file)
@@ -17,30 +17,133 @@ cache:
   - sccache/
 
 stages:
+- check
 - build
 - publish
 
 # format and freshness checks
-check:
-  stage: build
+fmt:
+  stage: check
   script:
   - cargo fmt --package ostree -- --check
+
+gir:
+  stage: check
+  script:
   - rm -rf src/auto/
   - make gir
   - git checkout -- sys/src/auto/versions.txt src/auto/versions.txt
   - git diff -R --exit-code
 
-# build
-build_all-features:
-  stage: build
+clippy:
+  stage: check
   script:
-  - cargo clippy --all --features latest
-  - cargo test --verbose --all --features latest
+  - cargo clippy --all --all-features
 
+# build
 build_default-features:
   stage: build
   script:
-  - cargo test --verbose --all
+    - cargo test --verbose --all
+
+# all feature levels
+build_v2014_9:
+  stage: build
+  script: cargo test --verbose --all --features v2014_9
+build_v2015_7:
+  stage: build
+  script: cargo test --verbose --all --features v2015_7
+build_v2016_14:
+  stage: build
+  script: cargo test --verbose --all --features v2016_14
+build_v2016_4:
+  stage: build
+  script: cargo test --verbose --all --features v2016_4
+build_v2016_5:
+  stage: build
+  script: cargo test --verbose --all --features v2016_5
+build_v2016_6:
+  stage: build
+  script: cargo test --verbose --all --features v2016_6
+build_v2016_7:
+  stage: build
+  script: cargo test --verbose --all --features v2016_7
+build_v2016_8:
+  stage: build
+  script: cargo test --verbose --all --features v2016_8
+build_v2017_1:
+  stage: build
+  script: cargo test --verbose --all --features v2017_1
+build_v2017_10:
+  stage: build
+  script: cargo test --verbose --all --features v2017_10
+build_v2017_11:
+  stage: build
+  script: cargo test --verbose --all --features v2017_11
+build_v2017_12:
+  stage: build
+  script: cargo test --verbose --all --features v2017_12
+build_v2017_13:
+  stage: build
+  script: cargo test --verbose --all --features v2017_13
+build_v2017_15:
+  stage: build
+  script: cargo test --verbose --all --features v2017_15
+build_v2017_2:
+  stage: build
+  script: cargo test --verbose --all --features v2017_2
+build_v2017_3:
+  stage: build
+  script: cargo test --verbose --all --features v2017_3
+build_v2017_4:
+  stage: build
+  script: cargo test --verbose --all --features v2017_4
+build_v2017_6:
+  stage: build
+  script: cargo test --verbose --all --features v2017_6
+build_v2017_7:
+  stage: build
+  script: cargo test --verbose --all --features v2017_7
+build_v2017_8:
+  stage: build
+  script: cargo test --verbose --all --features v2017_8
+build_v2017_9:
+  stage: build
+  script: cargo test --verbose --all --features v2017_9
+build_v2018_2:
+  stage: build
+  script: cargo test --verbose --all --features v2018_2
+build_v2018_3:
+  stage: build
+  script: cargo test --verbose --all --features v2018_3
+build_v2018_5:
+  stage: build
+  script: cargo test --verbose --all --features v2018_5
+build_v2018_6:
+  stage: build
+  script: cargo test --verbose --all --features v2018_6
+build_v2018_7:
+  stage: build
+  script: cargo test --verbose --all --features v2018_7
+build_v2018_9:
+  stage: build
+  script: cargo test --verbose --all --features v2018_9
+build_v2019_2:
+  stage: build
+  script: cargo test --verbose --all --features v2019_2
+build_v2019_3:
+  stage: build
+  script: cargo test --verbose --all --features v2019_3
+build_v2019_4:
+  stage: build
+  script: cargo test --verbose --all --features v2019_4
+build_v2019_6:
+  stage: build
+  script: cargo test --verbose --all --features v2019_6
+build_v2020_1:
+  stage: build
+  script: cargo test --verbose --all --features v2020_1
+# all feature levels
 
 # docs
 docs:
index 09ffcb66744acc1df28663b2550870f284eb579e..d018f0966d26133510ec9871f48b952e3510f324 100644 (file)
@@ -81,4 +81,3 @@ v2019_3 = ["v2019_2", "ostree-sys/v2019_3"]
 v2019_4 = ["v2019_3", "ostree-sys/v2019_4"]
 v2019_6 = ["v2019_4", "ostree-sys/v2019_6"]
 v2020_1 = ["v2019_6", "ostree-sys/v2020_1"]
-latest = ["v2020_1"]
index 822ad7eaefaa570efedc7986bbe25de73785c9be..3b1380d8c05c359bc74c0aab461cfbc0a724e675 100644 (file)
@@ -3,7 +3,7 @@ RUSTDOC_STRIPPER_VERSION := 0.1.9
 
 all: gir
 
-.PHONY: gir gir-report update-gir-files remove-gir-files merge-lgpl-docs
+.PHONY: gir gir-report update-gir-files remove-gir-files merge-lgpl-docs ci-build-stages
 
 
 # -- gir generation --
@@ -47,3 +47,12 @@ gir-files:
 gir-files/OSTree-1.0.gir:
        echo Best to build libostree with all features and use that
        exit 1
+
+
+# CI config generation
+ci-build-stages:
+       @for tgt in `cargo read-manifest | jq -jr '.features | keys | map(select(. != "dox")) | map(. + " ") | .[]'`; do \
+               echo "build_$$tgt:"; \
+               echo "  stage: build"; \
+               echo "  script: cargo test --verbose --all --features $$tgt"; \
+       done